/*
 * @Descripttion:
 * @Author: liang
 * @Date: 2020-03-23 10:08:16
 * @LastEditors: cuiyingchun
 * @LastEditTime: 2022-11-05 19:35:02
 */
/**
 * 配置参考: https://cli.vuejs.org/zh/config/
 */
const path = require('path')
function resolve (dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  chainWebpack: config => {
    const svgRule = config.module.rule('svg')
    svgRule.uses.clear()
    svgRule
      .test(/\.svg$/)
      .use('svg-sprite-loader')
      .loader('svg-sprite-loader')

    config.resolve.alias
      .set('@', resolve('src'))
      .set('assets', resolve('src/assets'))
  },
  configureWebpack: {
    // 把原本需要写在webpack.config.js中的配置代码 写在这里 会自动合并
  },
  productionSourceMap: false,
  devServer: {
    open: true,
    port: 8003,
    overlay: {
      errors: true,
      warnings: true
    }
  }
}
